<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class webim_panel_entry extends JR_Module {

	// public $module_folder_name = "baidu_map";
	public function index()
	{ 
		$webim_classes = $this->db->get('webim_class')->result(); 
		$current_class_id = null;
		if(!empty($_GET['class-id']))
		{
			$current_class_id = $_GET['class-id'] ;
		}
		else
		{
			if(sizeof($webim_classes)>0)
			{
				$current_class_id = $webim_classes[0]->id ;
			}
		}
		
		$current_class_webims = Array(); 
		
		if($current_class_id!=null)
		{
			$current_class_webims 
				= $this->db->get_where('webim',array('class_id'=>$current_class_id))->result(); 
			
			$params = Array(
					'webim_classes'=>$webim_classes,
					'current_class_id'=>$current_class_id,
					'current_class_webims'=>$current_class_webims
			);
			$this->load->view('admin/v_entry',$params);
		}
	}

}
